import { Module, ValidationPipe } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { CommentModule } from 'lib/comment';
import { APP_PIPE } from '@nestjs/core';
import { UserController } from './user.controller';
import { UserService } from './user.service';
import { User } from 'libs/db/entity/user.entity';
import { AuthModule } from 'libs/auth';

@Module({
    imports: [
        CommentModule,
        TypeOrmModule.forFeature([User]),
        AuthModule
    ],
    controllers: [
        UserController,

    ],
    providers: [
        UserService,
        {
            provide: APP_PIPE,
            useClass: ValidationPipe
        }
    ],
    exports: [
        UserService
    ]
})
export class UserModule { }
